const fs = require('fs');
module.exports = function ({types}){
    // console.log(types, 'types');
    // fs.writeFile('/build/nodes.txt', JSON.stringify(types), (err) => {
    //     console.log(err, 'err');
    // });
    return {
        name: "simple-plugin",
        visitor: {
            Identifier(path, state){
                console.log(path.node, 'path.node');
                if(path.node.name === 'a') {
                    path.node.name = 'good';
                }
            },
            DeclareVariable(path, state) {
                console.log(path, 'path');
                console.log(state, 'state');
                if(path.node.name === 'a') {
                    path.node.name = 'good';
                }
            },
            BinaryExpression(path, state) {
                console.log(path, 'path');
                console.log(state, 'state');
            }
        },
        
    }
} 